***************************************************
****----			Table A11	  		   ----****
***************************************************

clear all
cap log close 
set more off

****---- Change directory

global data "/Users/Replication material/Data"

****---- Analysis

use "$data/dataset_replication_2018.dta", clear


qui reg gini2018_log aug_dec_18_sd, cluster(distretto_FE)
est store reg11_All
qui reg gini2018_log aug_dec_18_sd Capoluogodiprovincia  population_density_1911, cluster(distretto_FE)
est store reg12_All
qui reghdfe gini2018_log aug_dec_18_sd Capoluogodiprovincia  population_density_1911, cluster(distretto_FE) absorb(i.province_FE i.Zonaaltimetrica)
est store reg13_All
qui reghdfe gini2018_log aug_dec_18_sd  Capoluogodiprovincia  population_density_1911, cluster(distretto_FE) absorb(i.Zonaaltimetrica i.distretto_FE)
est store reg14_All

qui reg gini2018_log aug_dec_18_sd if sample_1924==1, cluster(distretto_FE)
est store reg11_Red
qui reg gini2018_log aug_dec_18_sd Capoluogodiprovincia  population_density_1911 if sample_1924==1, cluster(distretto_FE)
est store reg12_Red
qui reghdfe gini2018_log aug_dec_18_sd Capoluogodiprovincia  population_density_1911 if sample_1924==1, cluster(distretto_FE) absorb(i.province_FE i.Zonaaltimetrica)
est store reg13_Red
qui reghdfe gini2018_log aug_dec_18_sd  Capoluogodiprovincia  population_density_1911 if sample_1924==1, cluster(distretto_FE) absorb(i.Zonaaltimetrica i.distretto_FE)
est store reg14_Red

esttab reg11_All reg12_All reg13_All reg14_All reg11_Red reg12_Red reg13_Red reg14_Red , keep(aug_dec_18*) se r2 staraux collabels(, none) ml(,none) cells(b(star fmt (%9.3f)) se(par)) star(* 0.10 ** 0.05 *** 0.01) replace


qui reg gini2018_log aug_dec_18_sdD, cluster(distretto_FE)
est store reg21_All
qui reg gini2018_log aug_dec_18_sdD Capoluogodiprovincia  population_density_1911, cluster(distretto_FE)
est store reg22_All
qui reghdfe gini2018_log aug_dec_18_sdD Capoluogodiprovincia  population_density_1911, cluster(distretto_FE) absorb(i.province_FE i.Zonaaltimetrica)
est store reg23_All
qui reghdfe gini2018_log aug_dec_18_sdD  Capoluogodiprovincia  population_density_1911, cluster(distretto_FE) absorb(i.Zonaaltimetrica i.distretto_FE)
est store reg24_All


qui reg gini2018_log aug_dec_18_sdD if sample_1924==1, cluster(distretto_FE)
est store reg21_Red
qui reg gini2018_log aug_dec_18_sdD Capoluogodiprovincia  population_density_1911 if sample_1924==1, cluster(distretto_FE)
est store reg22_Red
qui reghdfe gini2018_log aug_dec_18_sdD Capoluogodiprovincia  population_density_1911 if sample_1924==1, cluster(distretto_FE) absorb(i.province_FE i.Zonaaltimetrica)
est store reg23_Red
qui reghdfe gini2018_log aug_dec_18_sdD  Capoluogodiprovincia  population_density_1911  if sample_1924==1, cluster(distretto_FE) absorb(i.Zonaaltimetrica i.distretto_FE)
est store reg24_Red

esttab reg21_All reg22_All reg23_All reg24_All reg21_Red reg22_Red reg23_Red reg24_Red , keep(aug_dec_18*) se r2 staraux collabels(, none) ml(,none) cells(b(star fmt (%9.3f)) se(par)) star(* 0.10 ** 0.05 *** 0.01) replace
